


from django.shortcuts import render
from django.db import connection
import requests
import json

from django.shortcuts import render
from django.db import connection
import requests
import json
def index(request, html_file_name):
    print(html_file_name)
    api_request = requests.get("http://www.baidu.com")
    #   table    tb_xgfhfrtx
    resp = {
        'title':'    title 标题  >>>  ',
        "key": "api_request.content"
    }
    renderrr_path="html_demo/"+html_file_name
    return render(request, renderrr_path , context=resp)






#
# # 连接 mysql 测试
# def xxxxxaaaa(request , html_file_name):
#     mycursor = connection.cursor()
#     mycursor.execute('   show databases;     ')
#     result = mycursor.fetchall()
#     print(result)
#     my_data = {
#         'title':'mysql test ...',
#         'aaa': result
#     }
#     return render(request, 'mysql/inde.html', context=my_data)
